# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=ki18n
pkgver=6.1.0
pkgrel=0
pkgdesc="Advanced internationalization framework"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later AND (LGPL-2.1-only OR LGPL-3.0-or-later)"
depends_dev="
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	doxygen
	graphviz
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/ki18n.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/ki18n-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# kcountrytest, kcountrysubdivisiontest, kcatalogtest and ktimezone are broken
	xvfb-run ctest --test-dir build --output-on-failure -E "(kcountry|kcountrysubdivision|kcatalog|ktimezone)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2f748d813a5b185b0f14932b589be6926b456c693d80e6f6dac1b15b91f5160001f426df833bac67147b9796874b723bf224206960d228561ff6bfd0a9b04cac  ki18n-6.1.0.tar.xz
"
